gtk_popover_popdown (GTK_POPOVER (data));
}
+extern void gtk_flow_box_disable_move_cursor (GtkFlowBox *box);
+
static void
setup_section (GtkEmojiChooser *chooser,
EmojiSection *section,
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (chooser->scrolled_window));
gtk_container_set_focus_vadjustment (GTK_CONTAINER (section->box), adj);
+ gtk_flow_box_disable_move_cursor (GTK_FLOW_BOX (section->box));
gtk_flow_box_set_filter_func (GTK_FLOW_BOX (section->box), filter_func, section, NULL);
g_signal_connect_swapped (section->button, "clicked", G_CALLBACK (scroll_to_section), section);
}
#include <config.h>
#include "gtkflowbox.h"
+#include "gtkflowboxprivate.h"
#include "gtkadjustment.h"
#include "gtkcontainerprivate.h"
GtkFlowBoxCreateWidgetFunc create_widget_func;
gpointer create_widget_func_data;
GDestroyNotify create_widget_func_data_destroy;
+
+ gboolean disable_move_cursor;
};
#define BOX_PRIV(box) ((GtkFlowBoxPrivate*)gtk_flow_box_get_instance_private ((GtkFlowBox*)(box)))
gtk_flow_box_select_and_activate (box, priv->cursor_child);
}
+void
+gtk_flow_box_disable_move_cursor (GtkFlowBox *box)
+{
+ GtkFlowBoxPrivate *priv = BOX_PRIV (box);
+
+ priv->disable_move_cursor = TRUE;
+}
+
static gboolean
gtk_flow_box_move_cursor (GtkFlowBox *box,
GtkMovementStep step,
GtkAdjustment *adjustment;
gboolean vertical;
+ if (priv->disable_move_cursor)
+ return FALSE;
+
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
if (vertical)
--- /dev/null
+/* GTK - The GIMP Toolkit
+ *
+ * Copyright (C) 2020 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_FLOW_BOX_PRIVATE_H__
+#define __GTK_FLOW_BOX_PRIVATE_H__
+
+#include "gtkflowbox.h"
+
+void gtk_flow_box_disable_move_cursor (GtkFlowBox *box);
+
+#endif